﻿using System;
using System.Text;
using CodeLibrary.NativeMethods.Native;

namespace CodeLibrary.NativeMethods.Utils
{
    public static class Kernel32Utils
    {
        public static IntPtr OpenProcess(
            ProcessAccessFlags dwDesiredAccess, bool bInheritHandle, int dwProcessId)
        {
            return Native.NativeMethods.OpenProcess(
                dwDesiredAccess, bInheritHandle, dwProcessId);
        }

        public static void CloseHandle(IntPtr hObject)
        {
            Native.NativeMethods.CloseHandle(hObject);
        }

        public static uint FormatMessage(
            uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId,
            StringBuilder lpBuffer,uint nSize, IntPtr arguments)
        {
            return Native.NativeMethods.FormatMessage(
                dwFlags, lpSource, dwMessageId, dwLanguageId, 
                lpBuffer, nSize, arguments);
        }
    }
}
